package com.nulldev.util.web.nCaptcha.demo;

import com.nulldev.util.io.FileUtil;
import com.nulldev.util.java.swing.font.FontManager;
import com.nulldev.util.net.IPUtil;
import com.nulldev.util.uri.server.v2.HttpServer2;
import com.nulldev.util.web.nCaptcha.nCaptcha;

public class nCaptchaDemo {

	public static void main(String[] args) throws Exception {
		FontManager.loadSystemSpecificFonts(); //setFont(FontManager.getFonts("Clear Sans Medium", "MADE Evolve Sans", "Biko", "Highway Gothic", "sans-serif"), 16);
		final HttpServer2 server = new HttpServer2(IPUtil.nextFreePortIterated(4900, 4905), false);
		nCaptcha.loadCaptchaSystem(server);
		server.addFileRAW("_captcha_logo.png", 
				FileUtil.getResourceAsFile(nCaptchaDemo.class, "/com/nulldev/util/web/nCaptcha/assets/ncaptcha2.png"));
		server.addFileString("", FileUtil.getResourceAsString(nCaptchaDemo.class, "captcha_demo.html"));
		server.addFileRAW("_captcha_nojsguide.html", 
				FileUtil.getResourceAsFile(nCaptchaDemo.class, "nojsguide.html"));
		//URIUtil2.openInBrowser(server);
	}
	
}
